<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ViewCadastrarFormulario
 *
 * @author antonio
 */
class ViewCadastrarFormulario extends IAbstractInterface implements IIntfacePagina{
    
    public $cursos = "";
    public $rendas = "";
    
    
    public function __construct($server, $banco, $login, $senha, $parametros = "") {
        parent::__construct($server, $banco, $login, $senha, $parametros);
        $this->gerarPagina();
    }


    public function gerarPagina() {
                
        $con  = new Conexcao($this->server,
                $this->banco,
                $this->login,
                $this->senha);
        
        $cursosDao = new CursoDAO($con->conec);
        $cursosDao->consultarTodosCursos();
        
        foreach ($cursosDao->cursos as $value) {
            $this->cursos .= "<option value='".$value->codigo."'>".utf8_encode($value->nome)."</option>";
        }
        
       $rendaDao = new RendaDAO($con->conec);
       $rendaDao->consultarTodosRendas();
       
       
       foreach ($rendaDao->rendas as $value) {
           $this->rendas .= "<option value='".$value->codigo."'>".$value->valor."</option>";
       }
           
    }  
    
}

?>
